#ifndef PERCEPTION_DEFS_H_
#define PERCEPTION_DEFS_H_
#include <Eigen/Core>
#include <vector>

#include "basic_settings.h"
#include "basic_type.h"
#include "common/point_cloud.h"
#include "data_type.h"
#include "fixed_array.h"

/// @brief bounding box
struct BoundingBox {
  uint8_t id;
  Point3f center;
  float length;
  float width;
  float height;
  float heading;
  float r;
  float score;
  std::uint16_t label;
  FixedArray<Point2f, 4> polygon;
  float vx;
  float vy;
  float ax;
  float ay;
};

struct TrackedObject {
  uint8_t id;
  Eigen::Vector3f center;
  Eigen::Vector3f size;
  float heading;
  float r;
  float score;
  std::uint16_t label;
  FixedArray<Point2f, 4> polygon;
  Eigen::Vector3f velocity;
  Eigen::Vector3f acceleration;
  /// @brief association score
  float association_score = 0.0f;
};

struct Obstacle {
  uint8_t id;
  Eigen::Vector3f center;
  Eigen::Vector3f size;
  float heading;
  Eigen::Vector3f velocity;
  Eigen::Vector3f acceleration;
};

struct PerceptionResult {
  /// @brief timestamp
  uint64_t timestamp;
  /// @brief deeplearning BoundingBox list
  FixedArray<BoundingBox, kMaxBoundingBoxNum> dl_boxes;
  /// @brief tracker objects list
  FixedArray<TrackedObject, kMaxTrackerObjectNum> tracker_objects;
  /// @brief map
  Map map;
  /// @brief DataFrame raw
  DataFrame const* data_frame_raw;
  ///@brief calib data raw
  FixedArray<MatrixData, kMaxCalibDataNum> const* calib_data;
  /// @brief output obstacles
  FixedArray<Obstacle, kMaxBoundingBoxNum> output_objects;
  /// @brief microseconds
  uint64_t total_run_time;
};

#endif  // !PERCEPTION_DEFS_H_
